﻿using System.IO;
using System.Reflection;
using System.Windows;
using LisenceUtils;
using LisenceUtils.Windows;

namespace TestProj
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            var assembly = Assembly.GetExecutingAssembly();
            var main = new Main();

            using (var mem = new MemoryStream())
            {
                var manifestResourceStream = assembly.GetManifestResourceStream("TestProj.LicenseVerify.cer");
                manifestResourceStream?.CopyTo(mem);
                main.CertPubicKeyData = mem.ToArray();
            }
            if (!main.ActivateLicense())
            {
                Close();
            }


            //var licenseSetting = new LicenseGenerate();
            //licenseSetting.ShowDialog();
        }
    }
}
